--- @param extension Package
--- @param HY HY_Utility
--- @param U Utility
return function(extension, HY, U)
    local hy_yakumo_ran = General:new(extension, "hy_yakumo_ran", "ten_k", 4, 4, General.Female)
    local shiki_technique = fk.CreateSkill {
        name = "shiki_technique",
    }
    shiki_technique:addEffect(fk.CardUseFinished, {
        can_trigger = function(self, event, target, player, data)
            return player:hasSkill(shiki_technique.name) and data.from == player
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player, data)
            local room = player.room
            local suit = data.card.suit
            local diffs = {}
            local sames = {}
            for _, id in ipairs(room.draw_pile) do
                if Fk:getCardById(id).suit ~= suit then
                    table.insertIfNeed(diffs, id)
                else
                    table.insertIfNeed(sames, id)
                end
            end
            local marks = player:getTableMark("@shiki_technique-turn")
            if suit ~= Card.NoSuit then
                table.insertIfNeed(marks, data.card:getSuitString(true))
            end
            if #diffs > 0 then
                local diff = table.random(diffs, 1)
                room:obtainCard(player, diff, false, fk.ReasonPrey, player, shiki_technique.name)
                table.insertIfNeed(marks, Fk:getCardById(diff[1]):getSuitString(true))
            end
            if #sames > 0 then
                local same = table.random(sames, 1)
                room:obtainCard(player, same, false, fk.ReasonPrey, player, shiki_technique.name)
                table.insertIfNeed(marks, Fk:getCardById(same[1]):getSuitString(true))
            end
            room:setPlayerMark(player, "@shiki_technique-turn", marks)
            for _, id in ipairs(player:getCardIds("h")) do
                if player:canUse(Fk:getCardById(id)) then
                    return
                end
            end
            room:setPlayerMark(player, "shiki_technique-round", 1)
        end,
    })
    shiki_technique:addEffect("prohibit", {
        prohibit_use = function(self, player, card)
            if player:hasSkill(shiki_technique.name) and table.contains(player:getTableMark("@shiki_technique-turn"), card:getSuitString(true)) then
                return true
            end
        end
    })
    shiki_technique:addEffect("invalidity", {
        invalidity_func = function(self, from, skill)
            if from:getMark("shiki_technique-round") ~= 0 and skill.name == shiki_technique.name then
                return true
            end
        end
    })
    extension:loadSkillSkels { shiki_technique }
    hy_yakumo_ran:addSkill("shiki_technique")
    Fk:loadTranslationTable {
        ["hy_yakumo_ran"] = "八云蓝",
        ["#hy_yakumo_ran"] = "式神与式神",
        ["designer:hy_yakumo_ran"] = "黑曜人形",
        ["illustrator:hy_yakumo_ran"] = "パチェキチ",
        ["cv:hy_yakumo_ran"] = "",

        ["shiki_technique"] = "式技",
        [":shiki_technique"] = "在你使用一张牌结算结束后，你从牌堆随机获得与之花色不同与相同的牌各一张，本回合你无法使用与这些牌花色相同的牌。然后若你的手牌均无法使用，“式技”失效直到本轮结束。",
        ["@shiki_technique-turn"] = "式技",
    }
end
